package cn.itsource.pojo.vo;

import cn.itsource.pojo.domain.Login;
import lombok.Data;

@Data
public class UserInfoVo {
    private String username;
    private String avatar;
    private String nickName;
    private String phone;
    private String token;
    private Long id;

    public static UserInfoVo toUserInfoVo(Login one,String token){
        UserInfoVo userInfoVo = new UserInfoVo();
        userInfoVo.setUsername(one.getUsername());
        userInfoVo.setAvatar(one.getAvatar());
        userInfoVo.setNickName(one.getNickName());
        userInfoVo.setPhone(one.getPhone());
        userInfoVo.setToken(token);
        userInfoVo.setId(one.getId());
        return userInfoVo;
    }
}
